package com.gack.business.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.gack.business.model.User;

@Repository
public interface UserRepository extends JpaRepository<User, String>,JpaSpecificationExecutor<User>{

	List<User> findByUsername(String username);//根据用户名查询用户
	List<User> findByJoinVideoNumEquals(@Param("joinVideoNum") Integer joinVideoNum);

	@Query("select count(u.id) from User u")
	public Long selectByCountId();
	
	public List<User> findByRegisterSource(@Param("registerSource") String registerSource);
	// 根据注册来源统计总数
	public Long countByRegisterSource(@Param("registerSource") String registerSource);
	

	
}
